
<meta charset="utf-8" />
<form class="form-horizontal" role="form"
	onsubmit="return submitForm(this);" action="mpomng/mobilemer/updatePayPwd.do">
	<input type="hidden" name="custId" id="up_pwd_custId">
	<br />
	<!-- 
	 * Input属性说明:
	 * validate="true"  是否需要验证字段
	 * msg="错误时提示信息"        
	 * datatype="数据类型"
	-->
	<div class="form-group">
		<label class="col-sm-3 control-label no-pEditing-right"
			for="form-field-1"> 原支付密码 ： </label>
		<div class="col-sm-9">
			<input type="password" id="oldPwd" name="oldPwd"
				class="col-xs-10 col-sm-7" value="" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label no-pEditing-right"
			for="form-field-1"> 新密码 ： </label>
		<div class="col-sm-9">
			<input type="password" id="newPwd" name="newPwd"
				class="col-xs-10 col-sm-7" value="" />
		</div>
	</div>
	<div class="form-group">	
		<label class="col-sm-3 control-label no-pEditing-right"
			for="form-field-1"> 确认新密码 ： </label>
		<div class="col-sm-9">
			<input type="password" id="_newPwd"
				class="col-xs-10 col-sm-7"  value=""/>
		</div>
	</div>
	

	<div class="form-actions align-right  form-button-box"
		style="margin-top: 10px">
			<button id="auditRefuse" class="btn btn-info" type="submit">
				 确定
			</button>
		<button class="btn" type="button"
			onclick="javascript:dialog.close(this);">关闭</button>
	</div>
</form>
<script type="text/javascript">
	$(document).ready(function() {
		//var custId = $.Dialog("dlg-setPayPwd").dataParam['custId'];
		try {
			var upDlg = dialog.getById("dlg-setPayPwd");
			var custId = dialog.getById("dlg-setPayPwd").dataParam['custId'];
			if(!custId){
				dialog.closeAll();
				return;
			}
			$("#up_pwd_custId").val(custId);
		} catch (e) {
			dialog.closeAll();
		}
		
	});
	
	function submitForm(obj){
		
		var oldPwd = $("#oldPwd").val();
		var newPwd = $("#newPwd").val();
		var _newPwd = $("#_newPwd").val();
		if(!oldPwd){
			msg.alert("错误", "旧密码不能为空", "error");
			return false;
		}
		if(!newPwd){
			msg.alert("错误", "新密码不能为空", "error");
			return false;
		}
		if(newPwd != _newPwd){
			msg.alert("错误", "两次输入的密码不一致", "error");
			return false;
		}
		
		//自定义匿名回调函数。 系统默认回调函数：dialogAjaxDone
		return validateCallback(obj,function(result){
			if(result.rspcod== 200){
				msg.alert("提示", result.rspmsg, 'correct');
				$("#grid-table").trigger("reloadGrid");
				dialog.close(obj);
			}else{
				msg.alert("错误", result.rspmsg + " 错误代码："
						+ result.rspcod, 'error');
			}
		});
	}
	
</script>
